<template>
  <div class="contain">
    <div
      class="cards"
      @mouseover="showHover = item.id"
      @mouseout="showHover = null"
      :class="`rarity_wujinag_${item.rarity}`"
    >
      <div style="width: 100%; height: 100%">
        <div class="top">
          <div class="name">{{ item.name }}</div>
          <!-- <div class="cost">{{ item.lv }}</div> -->
        </div>

        <div class="mid">
          <div class="image">
            <van-icon
              class="iconFont"
              class-prefix="icon"
              size="100"
              :class="`icon-${item.type}`"
            />
          </div>
          <div class="ablity">
            <div>{{ item.pow }}</div>
          </div>
        </div>
        <div class="bottom">
          <div>{{ item.desc }}</div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    item: {
      type: Object,
      default: () => {
        return {
          id: 999,
          name: "稻草人",
          type: "normal",
          pow: 1,
          int: 1,
          salary: 50,
          tactic_name: "恐惧",
          stratagem_name: "夜割",
          politics_name: "群鸦风暴",
        };
      },
    },
    index: {
      type: Number,
      default: null,
    },
  },
  data() {
    return {
      showHover: 314159,
    };
  },
};
</script>
<style lang="less" scoped>
.contain {
  border: 2px solid rgba(226, 217, 217, 0.8);
  padding: 10px;
  background-color: rgb(0, 0, 0);
  border-radius: 6px;
  font-size: 30px;
  text-align: center;
  width: 100%;
  height: 100%;
  position: relative;
  .cards {
    background-color: #fff;
    border-radius: 10px;
    width: 100%;
    height: 100%;
  }
}
.water {
  position: absolute;
  right: 0;
  bottom: 10px;
  opacity: 0.5;
}
.top {
  height: 15%;
  border: 2px solid #000000;
  border-top-right-radius: 6px;
  border-top-left-radius: 6px;
  display: flex;
  justify-content: space-between;
  .name {
    flex: 1;
  }
  .cost {
    display: inline-block;
    border-left: 2px solid #000000;
    align-self: center;
    min-width: 60px;
  }
}
.mid {
  height: 35%;
  border: 2px solid #000000;
  text-align: start;
  padding: 0 10px;
  display: flex;
  // padding: 10px 0 10px 10px;
  align-items: center;
  .ablity {
    font-size: 50px;
    font-weight: bolder;
    padding: 0 0 0 20px;
    text-align: center;
  }
}
.bottom {
  text-align: start;
  height: calc(50% - 30px);
  border: 2px solid #000000;
  padding: 10px;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;

  font-size: 20px;
}
.map-hover {
  border: 2px solid #737373;
  position: absolute;
  background-color: #e9c1c1;
  z-index: 9999;
  width: 100%;
  height: 40%;
  top: 70%;
  border-radius: 6px;
  text-align: start;
  padding: 10px;

  font-size: 20px;
}

.map-hover::-webkit-scrollbar {
  display: none;
}
</style>
